<?php

declare(strict_types=1);

namespace App\Request\User;

use Hyperf\Validation\Request\FormRequest;

class UpdateUserInfoRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'avatar' => 'nullable',
            'nick_name' => 'nullable',
            'company_name' => 'nullable',
            'name' => 'nullable',
            'phone' => 'nullable',
            'birthday' => 'nullable',
            'email' => 'nullable',
            'sex' => 'nullable',
            'remark' => 'nullable',
            'password' => 'nullable',
            'user_type' => 'nullable|in:1,2,3',
        ];
    }

    public function messages(): array
    {
        return [
            'user_type.in' => '账号类型错误',
        ];
    }
}
